package com.hl.ruoyizmhshop.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hl.ruoyizmhshop.mapper.UserGoodsSaveMapper;
import com.hl.ruoyizmhshop.domain.UserGoodsSave;
import com.hl.ruoyizmhshop.service.IUserGoodsSaveService;

/**
 * 用户商品收藏Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-13
 */
@Service
public class UserGoodsSaveServiceImpl implements IUserGoodsSaveService 
{
    @Autowired
    private UserGoodsSaveMapper userGoodsSaveMapper;

    /**
     * 查询用户商品收藏
     * 
     * @param userId 用户商品收藏主键
     * @return 用户商品收藏
     */
    @Override
    public UserGoodsSave selectUserGoodsSaveByUserId(Long userId)
    {
        return userGoodsSaveMapper.selectUserGoodsSaveByUserId(userId);
    }

    /**
     * 查询用户商品收藏列表
     * 
     * @param userGoodsSave 用户商品收藏
     * @return 用户商品收藏
     */
    @Override
    public List<UserGoodsSave> selectUserGoodsSaveList(UserGoodsSave userGoodsSave)
    {
        return userGoodsSaveMapper.selectUserGoodsSaveList(userGoodsSave);
    }

    /**
     * 新增用户商品收藏
     * 
     * @param userGoodsSave 用户商品收藏
     * @return 结果
     */
    @Override
    public int insertUserGoodsSave(UserGoodsSave userGoodsSave)
    {
        userGoodsSave.setCreateTime(DateUtils.getNowDate());
        return userGoodsSaveMapper.insertUserGoodsSave(userGoodsSave);
    }

    /**
     * 修改用户商品收藏
     * 
     * @param userGoodsSave 用户商品收藏
     * @return 结果
     */
    @Override
    public int updateUserGoodsSave(UserGoodsSave userGoodsSave)
    {
        return userGoodsSaveMapper.updateUserGoodsSave(userGoodsSave);
    }

    /**
     * 批量删除用户商品收藏
     * 
     * @param userIds 需要删除的用户商品收藏主键
     * @return 结果
     */
    @Override
    public int deleteUserGoodsSaveByUserIds(Long[] userIds)
    {
        return userGoodsSaveMapper.deleteUserGoodsSaveByUserIds(userIds);
    }

    /**
     * 删除用户商品收藏信息
     * 
     * @param userId 用户商品收藏主键
     * @return 结果
     */
    @Override
    public int deleteUserGoodsSaveByUserId(Long userId)
    {
        return userGoodsSaveMapper.deleteUserGoodsSaveByUserId(userId);
    }
}
